package com.boho.system.action;


             
/**
 * 
 *
 * @File name:  UpdateTSysRoleAction.java   修改【系统角色信息:T_ROLE】
 * @Create on:  2010-05-10 11:27:218
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        


            
import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.service.MessageService;

import com.boho.system.service.PermissionService;
import com.boho.system.service.RoleService;


            
        
public class UpdateTSysRoleAction extends ActionImp {

	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1002", MessageService.getMessage("BOHO_COMMON_1002"),"【系统角色信息】" ,ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		Integer roleid = atx.getIntegerValue("ROLE_ID",0);
		String rolename = atx.getStringValue("ROLE_NAME");
		String roledesc = atx.getStringValue("ROLE_DESC");
		RoleService.updateRoleByPK(atx, roleid, rolename, roledesc);
		String[] funids = (String[])atx.getArrayValue("FUNCTION_ID");
		PermissionService.updateRoleFunction(atx, roleid, funids);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		return 1;
	}
}
